package com.liang.lessonIp;

import java.net.MalformedURLException;
import java.net.URL;

public class URL01 {
    public static void main(String[] args) throws MalformedURLException {
        URL url = new URL("http://localhost:8080");

        System.out.println(url.getProtocol());//协议
        System.out.println(url.getPort());//端口
        System.out.println(url.getHost());//主机IP
        System.out.println(url.getQuery());//
    }
}
